package com.qf.exception;

import org.apache.shiro.authz.UnauthorizedException;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

/**
 * 全局异常处理器
 * @author lixu
 *
 */
@ControllerAdvice
public class GlobalExceptionResolver {

    /**
     * 未授权异常 转发到  提示页面
     * @param e
     * @return
     */
    @ExceptionHandler(UnauthorizedException.class)
    public String handlerUnauthorizedException(UnauthorizedException e, Model model){
        model.addAttribute("error","gp14");

        return "/unauthorizedUrl.jsp";
    }
}
